<template>
  <el-main>
    <myNotice :notice="info" />
  </el-main>
</template>

<script>
import myNotice from '@/components/MyNotice'
  export default {
    components: { myNotice },
    data(){
      return {
        info: {
          title:'',
          content:'',
          tid:'',
          no:'',
          uid: this.$store.getters.userId,
          status:'',
        }
      }
    },
    created(){
      this.info.no = this.getId();
    },
    methods:{
      //获取随机数id生成公告号
      getId() {
        let date = Date.now();
        let rund = Math.ceil(Math.random()*1000)
        let id = 'notice'+date+''+ rund;
        return id;
      },
    }
  }
</script>

<style lang="scss" scoped>

</style>
